<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>gdata.objson.objson.OBJson</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css"></link>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">

<!-- =========== START OF NAVBAR =========== -->
<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="center">
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="trees.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="indices.html">Index</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar" align="right" width="100%">
      <table border="0" cellpadding="0" cellspacing="0">
      <tr><th class="navbar" align="center">
        <p class="nomargin">
          objson
      </p></th></tr></table>
    </th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <font size="-1"><b class="breadcrumbs">
        Package&nbsp;gdata ::
        Package&nbsp;objson ::
        <a href="gdata.objson.objson-module.html">Module&nbsp;objson</a> ::
        Class&nbsp;OBJson
      </b></font></br>
    </td>
    <td><table cellpadding="0" cellspacing="0">
      <tr><td align="right"><font size="-2">[show&nbsp;private&nbsp;|&nbsp;<a href="../public/gdata.objson.objson.OBJson-class.html">hide&nbsp;private</a>]</font></td></tr>
      <tr><td align="right"><font size="-2">[<a href="frames.html"target="_top">frames</a>&nbsp;|&nbsp;<a href="gdata.objson.objson.OBJson-class.html" target="_top">no&nbsp;frames</a>]</font></td></tr>
    </table></td>
</tr></table>

<!-- =========== START OF CLASS DESCRIPTION =========== -->
<h2 class="class">Type OBJson</h2>

<pre class="base-tree">
<a href="__builtin__.object-class.html"><code>object</code></a> --+
         |
        <b>OBJson</b>
</pre><br />

<hr/>

<p>OBJson super class for creating subclasses.</p>
All JSON children (dict objects) will be constructed to a OBJson 
subclass by using it as a base class. subclasses will try to use the key 
as the class name (except $ =&gt; ___) and the child will be wrapped into 
the class object.
<hr/>


<!-- =========== START OF METHOD SUMMARY =========== -->
<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="summary">
  <th colspan="2">Method Summary</th></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gdata.objson.objson.OBJson-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>src</span>,
          <span class=summary-sig-arg>parent</span>)</span></code>
<br />
Object constructor.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gdata.objson.objson.OBJson-class.html#__iter__" class="summary-sig-name"><code>__iter__</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
An iterator method.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gdata.objson.objson.OBJson-class.html#__len__" class="summary-sig-name"><code>__len__</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
Length method to return the number of attributes.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><a name="__repr__"></a><span class="summary-sig"><span class="summary-sig-name">__repr__</span>(<span class=summary-sig-arg>self</span>)</span></code>
</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><a name="__str__"></a><span class="summary-sig"><span class="summary-sig-name">__str__</span>(<span class=summary-sig-arg>self</span>)</span></code>
</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gdata.objson.objson.OBJson-class.html#AddNameSpace" class="summary-sig-name"><code>AddNameSpace</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>ns</span>)</span></code>
<br />
Add namespace declaration(s) to the current object.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gdata.objson.objson.OBJson-class.html#AppendChild" class="summary-sig-name"><code>AppendChild</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>name</span>,
          <span class=summary-sig-arg>src</span>)</span></code>
<br />
Add a child element to this OBJson object.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gdata.objson.objson.OBJson-class.html#CreateChild" class="summary-sig-name"><code>CreateChild</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>name</span>,
          <span class=summary-sig-arg>src</span>)</span></code>
<br />
Create a new child under the current object.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gdata.objson.objson.OBJson-class.html#DeleteChild" class="summary-sig-name"><code>DeleteChild</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>child</span>)</span></code>
<br />
Function to remove a child object from the OBJson structure.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gdata.objson.objson.OBJson-class.html#DelNameSpace" class="summary-sig-name"><code>DelNameSpace</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>ns_name</span>)</span></code>
<br />
Remove namespace declaration from the current object.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gdata.objson.objson.OBJson-class.html#get" class="summary-sig-name"><code>get</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>attr</span>)</span></code>
<br />
retrieve value of an object attribute.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gdata.objson.objson.OBJson-class.html#GetAttrib" class="summary-sig-name"><code>GetAttrib</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
Return a tuple of attributes of the current OBJson object.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gdata.objson.objson.OBJson-class.html#GetChildren" class="summary-sig-name"><code>GetChildren</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
Function to return a list of child objects.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gdata.objson.objson.OBJson-class.html#GetAttrib" class="summary-sig-name"><code>GetNoChildren</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
Return a tuple of attributes of the current OBJson object.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gdata.objson.objson.OBJson-class.html#HasChild" class="summary-sig-name"><code>HasChild</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>child</span>)</span></code>
<br />
Function to return whether or not the current object
   node has child as a child node.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gdata.objson.objson.OBJson-class.html#InsertChild" class="summary-sig-name"><code>InsertChild</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>name</span>,
          <span class=summary-sig-arg>src</span>,
          <span class=summary-sig-arg>refobj</span>)</span></code>
<br />
Function to insert a child node to an existing child node list.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gdata.objson.objson.OBJson-class.html#MakeClone" class="summary-sig-name"><code>MakeClone</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
Function to return a copy of self object.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gdata.objson.objson.OBJson-class.html#UpdateChild" class="summary-sig-name"><code>UpdateChild</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>name</span>,
          <span class=summary-sig-arg>src</span>)</span></code>
<br />
Function to update a child object.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gdata.objson.objson.OBJson-class.html#UpdateNameSpace" class="summary-sig-name"><code>UpdateNameSpace</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>ns</span>)</span></code>
<br />
Replace namespace declaration with the passi-in value.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="../private/gdata.objson.objson.OBJson-class.html#_DoDelParent" class="summary-sig-name"><code>_DoDelParent</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
Remove the parent reference of the current object.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="../private/gdata.objson.objson.OBJson-class.html#_DoGetParent" class="summary-sig-name"><code>_DoGetParent</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
Function to define the parent read-only property

Returns:
  The parent object of current object.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="../private/gdata.objson.objson.OBJson-class.html#_DoSetParent" class="summary-sig-name"><code>_DoSetParent</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>obj</span>)</span></code>
<br />
Set the current object's parent object.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="../private/gdata.objson.objson.OBJson-class.html#_HandleChild" class="summary-sig-name"><code>_HandleChild</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>action</span>,
          <span class=summary-sig-arg>name</span>,
          <span class=summary-sig-arg>obj</span>,
          <span class=summary-sig-arg>robj</span>)</span></code>
<br />
The actual OBJson child node handler.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="../private/gdata.objson.objson.OBJson-class.html#_HandleList" class="summary-sig-name"><code>_HandleList</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>key</span>,
          <span class=summary-sig-arg>alist</span>)</span></code>
<br />
Handle a list structure of a JSON element.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="../private/gdata.objson.objson.OBJson-class.html#_parse" class="summary-sig-name"><code>_parse</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>data</span>)</span></code>
<br />
Method to convert python dict structure to OBJson object.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="../private/gdata.objson.objson.OBJson-class.html#_ParseFile" class="summary-sig-name"><code>_ParseFile</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>src</span>)</span></code>
<br />
Parse content of the file object using cjson module.</td></tr>
<tr bgcolor="#e8f0f8" class="group">
  <th colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;Inherited from object</th></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>
<br />
x.__delattr__('name') &lt;==&gt; del x.name</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>
<br />
x.__getattribute__('name') &lt;==&gt; x.name</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class=summary-sig-arg>x</span>)</span></code>
<br />
x.__hash__() &lt;==&gt; hash(x)</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class=summary-sig-arg>T</span>,
          <span class=summary-sig-arg>S</span>,
          <span class="summary-sig-vararg">...</span>)</span></code>
<br />
T.__new__(S, ...) -&gt; a new object with type S, a subtype of T</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>
<br />
helper for pickle</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>
<br />
helper for pickle</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code>
<br />
x.__setattr__('name', value) &lt;==&gt; x.name = value</td></tr>
</table><br />


<!-- =========== START OF PROPERTY SUMMARY =========== -->
<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="summary">
  <th colspan="2">Property Summary</th></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><b><a href="gdata.objson.objson.OBJson-class.html#GetAttrs"><code>GetAttrs</code></a></b></td></tr><tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><b><a href="gdata.objson.objson.OBJson-class.html#GetName"><code>GetName</code></a></b></td></tr><tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><b><a href="gdata.objson.objson.OBJson-class.html#ParentObj"><code>ParentObj</code></a></b>: OBJson parent object property</td></tr></table><br />


<!-- =========== START OF METHOD DETAILS =========== -->
<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="details">
  <th colspan="2">Method Details</th></tr>
</table>

<a name="__init__"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">__init__</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>src</span>=<span class=sig-default>None</span>,
          <span class=sig-arg>parent</span>=<span class=sig-default>None</span>)</span>
    <br /><i>(Constructor)</i>
  </h3>
<pre class="literalblock">
Object constructor. Initialize the object and automatically
   call the internal parse function.

Args:
  src: A passed in data source. It can be in following formats:
       1. file-list object. A python file object.
       2. JSON data string. For example, a JSON feed response body.
          This will get converted to a StringIO object which is actually
          a file-like object. It supports read() function.
       3. Python data structure such as cjson parsed JSON feed. This will
          be handed over directly to _parse function.
          The first three will be read in using file read() function and
          parsed by cjson to a python dict object, and then will hand over
          to _parse to objectify.
       4. a file containing JSON feed strings.

Raises:
  ObjsonRuntimeError, when none of the above data format can be
  applied.
</pre>
  <dl><dt></dt><dd>
    <dl><dt><b>Overrides:</b></dt>
      <dd><a href="__builtin__.object-class.html#__init__"><code>__builtin__.object.__init__</code></a></dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="__iter__"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">__iter__</span>(<span class=sig-arg>self</span>)</span>
  </h3>
<pre class="literalblock">
An iterator method.

Returns:
  Iterator object to return key,value pair
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="__len__"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">__len__</span>(<span class=sig-arg>self</span>)</span>
    <br /><i>(Length operator)</i>
  </h3>
<pre class="literalblock">
Length method to return the number of attributes.

Returns:
  The number of attributes for this object.
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="AddNameSpace"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">AddNameSpace</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>ns</span>)</span>
  </h3>
<pre class="literalblock">
Add namespace declaration(s) to the current object.

Args:
  ns: a namespace dict to add.
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="AppendChild"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">AppendChild</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>name</span>,
          <span class=sig-arg>src</span>)</span>
  </h3>
<pre class="literalblock">
Add a child element to this OBJson object.

The source must be either a dict or a converted OBJson object.
current object MUST have an existing child already.

1. When src is a dict. It will be sent to the factory
   to create the OBJson object using the name provided.
2. When the src is an OBJson object, it will be linked directly.

In both these cases:
1. If this child does not exist yet (meaning does
   not have that object class name as the attribute), the
   object will be linked directly.
2. If there is a child, then it will create
   a list and assign the existing child(ren) and the newly
   created child to this list and link it.
3. If there has a list of child, then it will
   simply just append the new OBJson object to that list.

Args:
  name: the attribute name of the child node.
  src: either a dict or an OBJson object.
       if not provide, default creates an empty dict object.

Raises:
  OBJsonAttributeError, when there is no an existing child.
  OBJsonTypeError, the pass-in param isn't something parseable.

Example:
  self.AppendChild('author',{'name':'foo','email':'foo&#64;gmail.com'})
  self.AppendChild('author', au) # au is an author object.
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="CreateChild"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">CreateChild</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>name</span>,
          <span class=sig-arg>src</span>)</span>
  </h3>
<pre class="literalblock">
Create a new child under the current object.

If child name exists, then pass it to AppendChild method.

Args:
  name: the new child name
  src: source data to attach to this child node.
         data type can be either a dict or OBJson object.
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="DeleteChild"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">DeleteChild</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>child</span>)</span>
  </h3>
<pre class="literalblock">
Function to remove a child object from the OBJson structure.

This will remove the object itself and also the key pointing to the object.

Args:
  name: the child need to remove.

Raises:
  OBJsonNoKeyFound: if there is no such child attribute found.
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="DelNameSpace"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">DelNameSpace</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>ns_name</span>)</span>
  </h3>
<pre class="literalblock">
Remove namespace declaration from the current object.

Args:
  ns_name: a string indicating the namespace.

Returns:
  boolean: whether or not the method is done successfully.

Raises:
  OBJsonTypeError: When the pass in param isn't string Type.
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="get"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">get</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>attr</span>)</span>
  </h3>
<pre class="literalblock">
retrieve value of an object attribute.

Args:
  attr: attribute name used to retrieve its value.

Raises:
  OBJsonAttributeError, when there is no much attribute found.
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="GetAttrib"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">GetAttrib</span>(<span class=sig-arg>self</span>)</span>
  </h3>
  <p>Return a tuple of attributes of the current OBJson object.</p>
  This returns the attributes whose values are just plain text not sub 
  OBJson objects or list. It is simply an opposite way of GetChildren 
  method.
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="GetChildren"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">GetChildren</span>(<span class=sig-arg>self</span>)</span>
  </h3>
<pre class="literalblock">
Function to return a list of child objects.

Returns:
  A tuple of child objects. Otherwise, an empty tuple.
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="GetAttrib"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">GetNoChildren</span>(<span class=sig-arg>self</span>)</span>
  </h3>
  <p>Return a tuple of attributes of the current OBJson object.</p>
  This returns the attributes whose values are just plain text not sub 
  OBJson objects or list. It is simply an opposite way of GetChildren 
  method.
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="HasChild"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">HasChild</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>child</span>)</span>
  </h3>
<pre class="literalblock">
Function to return whether or not the current object
   node has child as a child node.

Args:
  child: Either a child node name string or a OBJson object.

Returns:
  boolean

Raises:
  OBJsonNoKeyFoundError
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="InsertChild"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">InsertChild</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>name</span>,
          <span class=sig-arg>src</span>,
          <span class=sig-arg>refobj</span>)</span>
  </h3>
<pre class="literalblock">
Function to insert a child node to an existing child node list.

If not, create the list first. refobj is the child node where
the new child node will insert before.

Args:
  name: the child name.
  refobj: The reference object where this new child node will be 
          inserted before.
  src: the data of the child. Can be either a dict or an OBJson object.

Raises:
  OBJsonTypeError: when passed in refobj is not an OBJson object.
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="MakeClone"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">MakeClone</span>(<span class=sig-arg>self</span>)</span>
  </h3>
<pre class="literalblock">
Function to return a copy of self object.

A deepcopy is necessary here since we want to create
a clone that is totally unrelated to the original object.

Returns:
  A deep copy of self. meaning every objects underneath
  and itself are copied to another memroy address.
  changing one object will not affact another one at all.
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="UpdateChild"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">UpdateChild</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>name</span>,
          <span class=sig-arg>src</span>)</span>
  </h3>
<pre class="literalblock">
Function to update a child object.

Similar function of CreateChild. Instead of adding, it replace the existing
subobject(child) to the new src. Implying that child MUST be pre-existing
already.

Args:
  name: the child name

  src:
    The new src. The format can be either
    a dict object or an OBJson object.
    If src is None, the child value will be
    vanished.
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="UpdateNameSpace"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">UpdateNameSpace</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>ns</span>)</span>
  </h3>
<pre class="literalblock">
Replace namespace declaration with the passi-in value.

Args:
  ns: a namespace dict used to update the existing one.

Returns:
  boolean: True when successfully updated, otherwise, return False.
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="_DoDelParent"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">_DoDelParent</span>(<span class=sig-arg>self</span>)</span>
  </h3>
  <p>Remove the parent reference of the current object.</p>
  Simply set it to None.
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="_DoGetParent"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">_DoGetParent</span>(<span class=sig-arg>self</span>)</span>
  </h3>
<pre class="literalblock">
Function to define the parent read-only property

Returns:
  The parent object of current object.
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="_DoSetParent"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">_DoSetParent</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>obj</span>)</span>
  </h3>
<pre class="literalblock">
Set the current object's parent object.

Args:
  obj: an OBJson object that will be assigned as the parent object.
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="_HandleChild"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">_HandleChild</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>action</span>,
          <span class=sig-arg>name</span>,
          <span class=sig-arg>obj</span>=<span class=sig-default>None</span>,
          <span class=sig-arg>robj</span>=<span class=sig-default>None</span>)</span>
  </h3>
<pre class="literalblock">
The actual OBJson child node handler.

Take child manipulation actions including, append, insert,
create, update, delete

Args:
  action: one of the above actions to take
  name: the child node attribute name
  obj: (optional)the child node object.
  robj: (optional)a reference object as of where the current child
        node should be placed when taking action 'insert'

Raises:
  OBJsonValueError, ValueError: when the refobj object isn't in the
  list.
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="_HandleList"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">_HandleList</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>key</span>,
          <span class=sig-arg>alist</span>)</span>
  </h3>
<pre class="literalblock">
Handle a list structure of a JSON element.

Args:
  key: the original dict key pointing to the list.
  alist: the list.

Return:
  a new list where structures underneath gets transferred to
  OBJson objects.
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="_parse"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">_parse</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>data</span>)</span>
  </h3>
<pre class="literalblock">
Method to convert python dict structure to OBJson object.

Args:
  data: python dict.
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="_ParseFile"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">_ParseFile</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>src</span>)</span>
  </h3>
<pre class="literalblock">
Parse content of the file object using cjson module.

This is will convert the JSON raw data feed to python dict strucutre.

Args:
  src: a file object.

Raises:
  OBJsonRuntimeError, when it can't parse the data.
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>
<br />


<!-- =========== START OF PROPERTY DETAILS =========== -->
<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="details">
  <th colspan="2">Property Details</th></tr>
</table>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>

<a name="GetAttrs"></a>
<h3>GetAttrs</h3>
<dl>
  <dt></dt>
  <dd>
    <dl>
      <dt><b>Get Method:</b></dt>
      <dd><span class="summary-sig"><span class="summary-sig-name">GetAttrs</span>(...)</span>
      </dd>
    </dl>
  </dd>
</dl></td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>

<a name="GetName"></a>
<h3>GetName</h3>
<dl>
  <dt></dt>
  <dd>
    <dl>
      <dt><b>Get Method:</b></dt>
      <dd><span class="summary-sig"><span class="summary-sig-name">GetName</span>(...)</span>
      </dd>
    </dl>
  </dd>
</dl></td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>

<a name="ParentObj"></a>
<h3>ParentObj</h3>
OBJson parent object property
<dl>
  <dt></dt>
  <dd>
    <dl>
      <dt><b>Get Method:</b></dt>
      <dd><span class="summary-sig"><a href="../private/gdata.objson.objson.OBJson-class.html#_DoGetParent" class="summary-sig-name"><code>_DoGetParent</code></a>(<span class=summary-sig-arg>self</span>)</span>
      </dd>
      <dt><b>Set Method:</b></dt>
      <dd><span class="summary-sig"><a href="../private/gdata.objson.objson.OBJson-class.html#_DoSetParent" class="summary-sig-name"><code>_DoSetParent</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>obj</span>)</span>
      </dd>
      <dt><b>Delete Method:</b></dt>
      <dd><span class="summary-sig"><a href="../private/gdata.objson.objson.OBJson-class.html#_DoDelParent" class="summary-sig-name"><code>_DoDelParent</code></a>(<span class=summary-sig-arg>self</span>)</span>
      </dd>
    </dl>
  </dd>
</dl></td></tr></table><br />


<!-- =========== START OF NAVBAR =========== -->
<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="center">
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="trees.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="indices.html">Index</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar" align="right" width="100%">
      <table border="0" cellpadding="0" cellspacing="0">
      <tr><th class="navbar" align="center">
        <p class="nomargin">
          objson
      </p></th></tr></table>
    </th>
  </tr>
</table>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td align="left"><font size="-2">Generated by Epydoc 2.1 on Mon Jul 16 16:43:14 2007</font></td>
    <td align="right"><a href="http://epydoc.sourceforge.net"
                      ><font size="-2">http://epydoc.sf.net</font></a></td>
  </tr>
</table>
</body>
</html>
